package com.win.pojo;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

@Component("user")
// 相当于配置文件中 <bean id="user" class="当前注解的类"/>
//@Component("user") 值不指定 默认当前类名首字母小写
@Scope("singleton")
public class User {
    //    public String name = "winner";
    @Value("win")
    public String name;

    @Value("winner")
    public void setName(String name) {
        this.name = name;
    }

}